This example of three donut charts shows how they can be nested inside each other.
This goes in the documents header:<script src="RGraph.common.core.js"></script> <script src="RGraph.pie.js"></script>Put this where you want the chart to show up:
<canvas id="cvs" width="550" height="550"> [No canvas support] </canvas>This is the code that generates the chart:
<script> window.onload = function () { var pie1 = new RGraph.Pie({ id: 'cvs', data: [4,3,5,6,8], options: { variant: 'donut', variantDonutWidth: 50, strokestyle: 'white', linewidth: 5, gutterLeft: 15, gutterRight: 15, gutterTop: 15, gutterBottom: 15, shadowBlur: 25, shadowOffsetx: 0, shadowOffsety: 0 } }).draw() var pie2 = new RGraph.Pie({ id: 'cvs', data: [5,4,8,6,2], options: { radius: pie1.radius - 50, variant: 'donut', variantDonutWidth: 50, strokestyle: 'white', linewidth: 5, shadow: false } }).draw() var pie3 = new RGraph.Pie({ id: 'cvs', data: [4,1,5,6,3], options: { radius: pie2.radius - 50, variant: 'donut', variantDonutWidth: 50, strokestyle: 'white', linewidth: 5, shadowBlur: 25, shadowOffsetx: 0, shadowOffsety: 0 } }).draw() RGraph.ObjectRegistry.bringToFront(pie2); }; </script>